<%inherit file="base.html"/>
<h2>
    ${_('Manage friends')}
</h2>
<div id="mainPanel">
    <div class="section" id="friends">
        <h3>
            ${_('Friends')} (${len(friend_list['index'])})
            <span class="inlineNav">
                <a href="http://admin.hexlabel.net/invite_person/" class="admin">${_('Invite...')}</a>
                <a href="http://my.hexlabel.net/">^ ${_('Back')}</a>
            </span>
        </h3>
        % if errors_friends:
            <div class="alert">${message_friends}</div>
        % elif message_friends:
            <div class="message">${message_friends}</div>
        % endif
        % if len(friend_list['index']) > 0:
            <ul class="listForm">
                % for iid in friend_list['index']:
                    <li>
                        <form method="post" action="http://admin.hexlabel.net/friends/" class="listForm">
                            <p>
                                <input type="hidden" name="iid" value="${iid}"/>
                            </p>
                            <dl>
                                % if friend_list['items'][iid]['stable']:
                                    <dd>
                                        <a href="http://${iid}.hexlabel.net/">
                                            <img src="${friend_list['items'][iid]['picture']}" alt="${friend_list['items'][iid]['name']}" class="thumbnail"/>
                                        </a>
                                        <a href="http://${iid}.hexlabel.net/">
                                            ${friend_list['items'][iid]['name']}
                                        </a>
                                    </dd>

                                    <dd class="buttons">
                                        <input type="submit" class="submit warn" name="revoke_friend" value="Revoke"/>
                                    </dd>
                                % else:
                                    <dd class="unstable">
                                        <a href="http://${iid}.hexlabel.net/">
                                            <img src="${friend_list['items'][iid]['picture']}" alt="${friend_list['items'][iid]['name']}" class="thumbnail"/>
                                        </a>
                                        <a href="http://${iid}.hexlabel.net/">
                                            ${friend_list['items'][iid]['name']}
                                        </a>
                                        <p>${_('This data is not available at the moment...')}</p>
                                    </dd>
                                % endif
                            </dl>
                            <div class="clr"><br/></div>
                        </form>
                    </li>
                % endfor
            </ul>
        % else:
            <ul>
                <li>${_('No friends')}</li>
            </ul>
        % endif
        <div class="clr"><br/></div>
    </div>
</div>

<!-- defs -->
<%def name="title()">P2P Fusion - Peerscape | ${profile_fields['generic']['name']['values'][0]['value']} | ${_('Manage friends')}</%def>
<%def name="body_class()">
    admin self person
</%def>
<%def name="toplinks_style()">
</%def>

